home *** CD-ROM | disk | FTP | other *** search
- /*
- * $VER: 1.01 (2-mar-1995)
- *
- * Arexx program for Visual to generate thumbnails with ADPro.
- * Written by C.Vallee
- *
- * This script generates thumbnails for all the selected file
- *
- */
-
- options results
- gfxport = "ADPro"
-
- /* Loading ADPro, if not present */
-
- if (~show('p',gfxport)) then do
- message "Loading ADPro..."
- address command "run ADPro:ADPro BEHIND"
- message "Waiting for the "||gfxport||" ARexx port..."
-
- /* Waiting for the ARexx port every 2 seconds until present */
- do while (~show('p',gfxport))
- address command "Wait 2"
- check
- if rc ~= 0 then exit
- end
- end
-
- GetInfo
- parse var result '"' mypalette '"' w h .
-
- address value gfxport
-
- SFORMAT "IFF"
-
- PLOAD mypalette
- PSTATUS "LOCKED"
- PTOTAL "HAM8"
- POFFSET 0
- PUSED 64
-
- address
-
- do forever
- check
- if rc ~= 0 then break
-
- getselected
- if result = "" then break
- file = result
-
- i = LASTPOS('/', file)
- if i = 0 then i = lastpos(':', file)
- name = substr( file , i+1 )
-
- message 'Loading "'||name||'"...'
-
- address
- LOAD '"'file'"'
-
- if rc = 0 then do
-
- IMAGE_TYPE
- ImageType = ADPRO_RESULT
-
- 'XSIZE'
- width = ADPRO_RESULT
-
- 'YSIZE'
- height = ADPRO_RESULT
-
- if ( width * h ) > (height * w ) then do
- height = ( height * w ) % width
- width = w
- end
- else do
- width = ( width * h ) % height
- height = h
- end
-
- address VISUAL message 'Scaling "'||name||'"...'
- ABS_SCALE width height
-
-
- IF (WORD( ImageType, 1 ) ~= "COLOR") THEN DO
- address VISUAL message 'Grey2Color "'||name||'"...'
- OPERATOR "GRAY_TO_COLOR"
- END
-
- address VISUAL message 'Rendering "'||name||'"...'
- RENDER_TYPE "HAM8"
- EXECUTE
-
- SAVE '"'file'.icn"' "IMAGE"
-
- address
- update
- end
- else do
- address
- unselect
- end
- end
-
- address
-
- Undo On
- Redraw On
-
- /* Quit ADPro */
- /* ADPRO_EXIT */
-